<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBookCommentsTable extends Migration
{
    /**
     *书籍评论表
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('book_comments', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->tinyInteger('module_id')->comment('模块标识:1小说;2漫画');
            $table->char('book_id', 11)->comment('被评论的书籍');
            $table->string('content', 255)->comment('评论内容');
            $table->integer('user_id')->comment('用户');
            $table->integer('like_num')->default(0)->comment('点赞次数');
            $table->integer('cai_num')->default(0)->comment('倒彩次数');
            $table->integer('pid')->default(0)->comment('回复关联的评论id');
            $table->tinyInteger('status')->default(1)->comment('状态0:删除1:待审核2:审核通过');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('book_comments');
    }
}
